public class Solution557 {
    public String reverseWords(String s) {
        String[] strings=s.split(" ");
        for (int i=0;i<strings.length;i++){
            strings[i]=new StringBuilder(strings[i]).reverse().toString();
        }
        StringBuilder stringBuilder=new StringBuilder(strings[0]);
        for (int i=1;i<strings.length;i++){
            stringBuilder.append(' ').append(strings[i]);
        }
        return stringBuilder.toString();
    }

    public static void main(String[] args) {
        System.out.println(new Solution557().reverseWords("Let's take LeetCode contest"));
    }
}
